<?php

class BMode_dao extends BMode
{
    static $instance = array();
    protected $_db = '';
    protected $_db_mysql = '';
    
    function __construct()
    {
        parent::__construct();
        $this->_db = B::i()->database;
        $this->_db_mysql = B::i()->database->default_mysql;
    }
    
    /**
     * 返回数据库实例
     *
     * @return object
     */
    function database()
    {
        return $this->_db_mysql;
    }
    
    function __get($name)
    {
        $engine = &$instance[$name];
        if (!is_object($engine)) {
            $engine = BLoader::instance("../Mode_dao_$name");
        }
        return $engine ? $engine : null;
    }

}

?>